<?php

namespace JLPay\Models\Merchant;

use JLPay\Models\BaseRequest;

/**
 * 商户进件请求
 */
class MerchantIncomingAddRequest extends BaseRequest
{
    /**
     * API接口路径
     */
    public const API_URL = '/open/merch/access/incoming/add';

    protected ?array $baseInfo = null;
    protected ?array $identificationInfo = null;
    protected ?array $businessInfo = null;
    protected ?array $settlementInfo = null;
    protected ?array $settlementRule = null;
    protected ?array $additionalInfo = null;
    protected ?array $smsConfig = null;
    protected ?array $funcInfo = null;
    protected ?array $chainStoreInfo = null;
    protected ?array $brandInfo = null;

    /**
     * 设置基础信息
     *
     * @param array $baseInfo
     * @return self
     */
    public function setBaseInfo(array $baseInfo): self
    {
        $this->baseInfo = $baseInfo;
        return $this;
    }

    /**
     * 设置身份信息
     *
     * @param array $identificationInfo
     * @return self
     */
    public function setIdentificationInfo(array $identificationInfo): self
    {
        $this->identificationInfo = $identificationInfo;
        return $this;
    }

    /**
     * 设置经营信息
     *
     * @param array $businessInfo
     * @return self
     */
    public function setBusinessInfo(array $businessInfo): self
    {
        $this->businessInfo = $businessInfo;
        return $this;
    }

    /**
     * 设置结算信息
     *
     * @param array $settlementInfo
     * @return self
     */
    public function setSettlementInfo(array $settlementInfo): self
    {
        $this->settlementInfo = $settlementInfo;
        return $this;
    }

    /**
     * 设置结算规则
     *
     * @param array $settlementRule
     * @return self
     */
    public function setSettlementRule(array $settlementRule): self
    {
        $this->settlementRule = $settlementRule;
        return $this;
    }

    /**
     * 设置附加信息
     *
     * @param array $additionalInfo
     * @return self
     */
    public function setAdditionalInfo(array $additionalInfo): self
    {
        $this->additionalInfo = $additionalInfo;
        return $this;
    }

    /**
     * 设置短信配置
     *
     * @param array $smsConfig
     * @return self
     */
    public function setSmsConfig(array $smsConfig): self
    {
        $this->smsConfig = $smsConfig;
        return $this;
    }

    /**
     * 设置功能信息
     *
     * @param array $funcInfo
     * @return self
     */
    public function setFuncInfo(array $funcInfo): self
    {
        $this->funcInfo = $funcInfo;
        return $this;
    }

    /**
     * 设置连锁店信息
     *
     * @param array $chainStoreInfo
     * @return self
     */
    public function setChainStoreInfo(array $chainStoreInfo): self
    {
        $this->chainStoreInfo = $chainStoreInfo;
        return $this;
    }

    /**
     * 设置品牌信息
     *
     * @param array $brandInfo
     * @return self
     */
    public function setBrandInfo(array $brandInfo): self
    {
        $this->brandInfo = $brandInfo;
        return $this;
    }

    /**
     * 检查是否需要加密
     *
     * @return bool
     */
    public function requiresEncrypt(): bool
    {
        return true;
    }

    /**
     * 获取敏感字段列表
     *
     * @return array
     */
    public function getSensitiveFields(): array
    {
        return [
            // 基础信息中的敏感字段
            'base_info.contact_info.contact_name',
            'base_info.contact_info.contact_phone',
            'base_info.contact_info.contact_id_no',
            
            // 身份信息中的敏感字段
            'identification_info.identity_info.id_card_name',
            'identification_info.identity_info.id_card_english_name',
            'identification_info.identity_info.id_card_no',
            'identification_info.identity_info.legal_person_phone',
            'identification_info.identity_info.id_card_address',
            
            // 结算信息中的敏感字段
            'settlement_info.account_info.account_no',
            'settlement_info.account_info.account_name',
            'settlement_info.account_info.bank_set_phone',
            'settlement_info.account_info.delegatee_name',
            'settlement_info.account_info.delegatee_id_card',
            'settlement_info.account_info.delegatee_phone',
            
            // 补充信息中的敏感字段
            'additional_info.specs_info.account_no',
            'additional_info.specs_info.account_name',

            // 品牌信息中的敏感字段
            'brand_info.contact_name',
            'brand_info.contact_phone'
        ];
    }
} 